<template>
  <div v-if="answer" class="answer">
    <h2>答案</h2>
    <p>{{ answer }}</p>
  </div>
  <div v-if="error" class="error">
    <p>{{ error }}</p>
  </div>
</template>

<script setup>
import { defineProps } from 'vue';

const props = defineProps({
  answer: {
    type: String,
    default: ''
  },
  error: {
    type: String,
    default: ''
  }
});
</script>

<style scoped>
.answer {
  margin-top: 20px;
}
.error {
  color: red;
  margin-top: 10px;
}
</style>